Skip to content

stream: stream/iter node.js streams interop#62469

Open
jasnell wants to merge 3 commits intonodejs:mainfrom
jasnell:jasnell/new-streams-classic-interop
Open

stream: stream/iter node.js streams interop#62469
jasnell wants to merge 3 commits intonodejs:mainfrom
jasnell:jasnell/new-streams-classic-interop

Conversation

@jasnell
Copy link
Copy Markdown
Member

@jasnell jasnell commented Mar 28, 2026

Implementing prototype integration points for experimental stream/iter and node.js stream.Readable/stream.Writable

Signed-off-by: James M Snell jasnell@gmail.com
Assisted-by: Opencode/Opus 4.6

jasnell added 3 commits March 27, 2026 20:20
Signed-off-by: James M Snell <jasnell@gmail.com>
Assisted-by: Opencode/Opus 4.6
Signed-off-by: James M Snell <jasnell@gmail.com>
Assisted-by: Opencode/Opus 4.6
Signed-off-by: James M Snell <jasnell@gmail.com>
Assisted-by: Opencode/Opus 4.6
@jasnell jasnell requested review from mcollina and ronag March 28, 2026 03:23
@jasnell jasnell added stream Issues and PRs related to the stream subsystem. experimental Issues and PRs related to experimental features. labels Mar 28, 2026
@nodejs-github-bot
Copy link
Copy Markdown
Collaborator

Review requested:

  • @nodejs/streams

@nodejs-github-bot nodejs-github-bot added lib / src Issues and PRs related to general changes in the lib or src directory. needs-ci PRs that need a full CI run. labels Mar 28, 2026
@jasnell jasnell changed the title Jasnell/new streams classic interop stream: stream/iter node.js streams interop Mar 28, 2026
@codecov
Copy link
Copy Markdown

codecov bot commented Mar 28, 2026

Codecov Report

❌ Patch coverage is 93.48958% with 50 lines in your changes missing coverage. Please review.
✅ Project coverage is 89.71%. Comparing base (e78ccd8) to head (e16afd4).
⚠️ Report is 7 commits behind head on main.

Files with missing lines Patch % Lines
lib/internal/streams/writable.js 92.08% 34 Missing and 2 partials ⚠️
lib/internal/streams/readable.js 96.45% 9 Missing and 1 partial ⚠️
lib/internal/streams/iter/from.js 78.94% 4 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #62469      +/-   ##
==========================================
+ Coverage   89.70%   89.71%   +0.01%     
==========================================
  Files         691      691              
  Lines      213935   214701     +766     
  Branches    41050    41218     +168     
==========================================
+ Hits       191907   192619     +712     
- Misses      14095    14146      +51     
- Partials     7933     7936       +3     
Files with missing lines Coverage Δ
lib/internal/errors.js 97.62% <100.00%> (+<0.01%) ⬆️
lib/internal/streams/iter/types.js 100.00% <100.00%> (ø)
lib/internal/streams/iter/from.js 88.72% <78.94%> (-0.37%) ⬇️
lib/internal/streams/readable.js 97.06% <96.45%> (-0.10%) ⬇️
lib/internal/streams/writable.js 95.35% <92.08%> (-1.29%) ⬇️

... and 24 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@nodejs-github-bot
Copy link
Copy Markdown
Collaborator

@nodejs-github-bot
Copy link
Copy Markdown
Collaborator

@nodejs-github-bot
Copy link
Copy Markdown
Collaborator

* from() will return such sources directly, skipping all normalization.
* This is NOT a public protocol symbol - it uses Symbol() not Symbol.for().
*/
const kTrustedSource = Symbol('kTrustedSource');
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Trusted seems the wrong name here if it is exported for use in arbitrary userland contracts.

For trusted I'd have assumed only hosts could generate these types say.

Perhaps use the term "valid" instead, something like kValidBufferSource?

Copy link
Copy Markdown
Member

@mcollina mcollina left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would prefer if these utilities to be exposed only in the new iter module as a function utilities instead of attaching them to the node stream
prototype

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

experimental Issues and PRs related to experimental features. lib / src Issues and PRs related to general changes in the lib or src directory. needs-ci PRs that need a full CI run. stream Issues and PRs related to the stream subsystem.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants